/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package dominio;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Cícero
 */
@Embeddable
public class CompraMateriaprimaPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "COD_MATPRIMA")
    private int codMatprima;
    @Basic(optional = false)
    @Column(name = "COD_COMPRA")
    private int codCompra;

    public CompraMateriaprimaPK() {
    }

    public CompraMateriaprimaPK(int codMatprima, int codCompra) {
        this.codMatprima = codMatprima;
        this.codCompra = codCompra;
    }

    public int getCodMatprima() {
        return codMatprima;
    }

    public void setCodMatprima(int codMatprima) {
        this.codMatprima = codMatprima;
    }

    public int getCodCompra() {
        return codCompra;
    }

    public void setCodCompra(int codCompra) {
        this.codCompra = codCompra;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) codMatprima;
        hash += (int) codCompra;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CompraMateriaprimaPK)) {
            return false;
        }
        CompraMateriaprimaPK other = (CompraMateriaprimaPK) object;
        if (this.codMatprima != other.codMatprima) {
            return false;
        }
        if (this.codCompra != other.codCompra) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "dominio.CompraMateriaprimaPK[codMatprima=" + codMatprima + ", codCompra=" + codCompra + "]";
    }

}
